package com.softwarerusher.model;

/**
 * TOrderdetailId entity.
 * 
 * @author MyEclipse Persistence Tools
 */

public class TOrderdetailId implements java.io.Serializable {

	// Fields

	private TBook TBook;
	private Integer orderNum;
	private TOrder TOrder;
	private Double price;

	// Constructors

	/** default constructor */
	public TOrderdetailId() {
	}

	/** full constructor */
	public TOrderdetailId(TBook TBook, Integer orderNum, TOrder TOrder,
			Double price) {
		this.TBook = TBook;
		this.orderNum = orderNum;
		this.TOrder = TOrder;
		this.price = price;
	}

	// Property accessors

	public TBook getTBook() {
		return this.TBook;
	}

	public void setTBook(TBook TBook) {
		this.TBook = TBook;
	}

	public Integer getOrderNum() {
		return this.orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	public TOrder getTOrder() {
		return this.TOrder;
	}

	public void setTOrder(TOrder TOrder) {
		this.TOrder = TOrder;
	}

	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TOrderdetailId))
			return false;
		TOrderdetailId castOther = (TOrderdetailId) other;

		return ((this.getTBook() == castOther.getTBook()) || (this.getTBook() != null
				&& castOther.getTBook() != null && this.getTBook().equals(
				castOther.getTBook())))
				&& ((this.getOrderNum() == castOther.getOrderNum()) || (this
						.getOrderNum() != null
						&& castOther.getOrderNum() != null && this
						.getOrderNum().equals(castOther.getOrderNum())))
				&& ((this.getTOrder() == castOther.getTOrder()) || (this
						.getTOrder() != null
						&& castOther.getTOrder() != null && this.getTOrder()
						.equals(castOther.getTOrder())))
				&& ((this.getPrice() == castOther.getPrice()) || (this
						.getPrice() != null
						&& castOther.getPrice() != null && this.getPrice()
						.equals(castOther.getPrice())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getTBook() == null ? 0 : this.getTBook().hashCode());
		result = 37 * result
				+ (getOrderNum() == null ? 0 : this.getOrderNum().hashCode());
		result = 37 * result
				+ (getTOrder() == null ? 0 : this.getTOrder().hashCode());
		result = 37 * result
				+ (getPrice() == null ? 0 : this.getPrice().hashCode());
		return result;
	}

}